package com.mall.service.mallFeature;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.mall.client.mallFeature.MallFeatureService;
import com.mall.custom.dao.read.MallFeatureReadMapper;
import com.mall.pojo.MallFeature;
import com.mall.pojo.MallFeatureExample;
import com.mall.pojo.MallFeatureExample.Criteria;
@Service
public class MallFeatureServiceImpl implements MallFeatureService {

	@Autowired
	private MallFeatureReadMapper mallFeatureReadMapper;
	@Override
	public List<MallFeature> getMallFeatureByMallIdAndType(Long mallId, Integer type) {
		MallFeatureExample example = new MallFeatureExample();
		Criteria criteria = example.createCriteria();
		criteria.andMallIdEqualTo(mallId);
		criteria.andStatusEqualTo(0);
		if(type != null){
			criteria.andTypeEqualTo(type);
		}
		return this.mallFeatureReadMapper.selectByExample(example);
	}

}
